1. Machine Coding:
Two players, two field; and have multiple ships located in their fields. They are guessing each others ship position and hitting. Tell who wins first. Design maintainable code which can incorporate future change....
Given four arrays A[], B[], C[], D[] and an integer K. The task is to find the number of combinations of four unique indices p, q, r, s such that A[p] + B[q] + C[r] + D[s] ≤ K....
Many times while solving problems, we face issues like time limit exceeds, wrong solution, runtime error, and memory limit exceeds because after designing algorithm we don’t test algorithm efficiency, correctness, time complexity and running the algorithm on a large set of inputs for testing purpose...
Binary Search Algorithm is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half. The idea of binary search is to use the information that the array is sorted and reduce the time complexity to O(log N)....
Merge sort is a sorting algorithm that follows the divide-and-conquer approach. It works by recursively dividing the input array into smaller subarrays and sorting those subarrays then merging them back together to obtain the sorted array....
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. For simplicity, assume that all bars have same width and the width is 1 unit....
Given a valid parenthesis string S, the task is to find the weight of the parenthesis based on the following conditions:...
Given an array arr[], and an integer N. The task is to maximize the sum of minimum and maximum of each group in a distribution of the array elements in N groups where the size of each group is given in an array b[] of size N....
Jio is having one of the most robust and fast pace interview process. Jio came to our campus for the position Of Graduate Engineer trainee and the job profile was of a data scientist....
Given a number N, the task is to find the minimum value K such that the sum of cubes of the first K natural number is greater than or equal to N. Examples:...
Given a string S of Size N. Initially, the value of count is 0. The task is to find the value of count after N operations to remove all the N characters of the given string S where each operation is:...
Given an array arr[] of N integers and number of queries Q. The task is to answer three types of queries....